import React from 'react'
import { AppRegistry } from 'react-native'
import {
  Provider
} from '@ant-design/react-native';

import dva from './utils/dva'
import Router, { routerMiddleware, routerReducer } from './router'
import appModel from './models/app'

const app = dva({
  initialState: {},
  models: [appModel],
  extraReducers: { router: routerReducer },
  onAction: [routerMiddleware],
  onError(e) {
    console.log('onError', e)
  },
})

const App = app.start(
	<Provider>
		<Router />
	</Provider>
)

import {name as appName} from '../app.json';

AppRegistry.registerComponent(appName, () => App)
